package com.t11;

/**
 * Created by xuyiwei on 2018/7/22.
 */
import java.util.*;
import static net.mindview.util.Print.*;

public class PrintingContainers {
    static Collection fill(Collection<String> collection) {
        collection.add("rat");
        collection.add("cat");
        collection.add("dog");
        collection.add("dog");
        return collection;
    }
    static Map fill(Map<String,String> map) {
        map.put("rat", "Fuzzy");
        map.put("cat", "Rags");
        map.put("dog", "Bosco");
        map.put("dog", "Spot");
        return map;
    }
    public static void main(String[] args) {
        print("ArrayList "+fill(new ArrayList<String>()));
        print("LinkedList "+fill(new LinkedList<String>()));
        print("HashSet "+fill(new HashSet<String>()));
        print("TreeSet "+fill(new TreeSet<String>()));
        print("LinkedHashSet "+fill(new LinkedHashSet<String>()));
        print("HashMap "+fill(new HashMap<String,String>()));
        print("TreeMap "+fill(new TreeMap<String,String>()));
        print("LinkedHashMap "+fill(new LinkedHashMap<String,String>()));
        /**
         * rrayList [rat, cat, dog, dog]
         LinkedList [rat, cat, dog, dog]
         HashSet [rat, cat, dog]
         TreeSet [cat, dog, rat]
         LinkedHashSet [rat, cat, dog]
         HashMap {rat=Fuzzy, cat=Rags, dog=Spot}
         TreeMap {cat=Rags, dog=Spot, rat=Fuzzy}
         LinkedHashMap {rat=Fuzzy, cat=Rags, dog=Spot}

         */
    }
}